package com.binzaijun.stock.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
@ConfigurationProperties(prefix = "elasticsearch")
public class ElasticsearchConfig {
    private List<String> hosts;
    private String username;
    private String password;
    @Value("${elasticsearch.index.stock-info}")
    private String stockInfoIndex;
    @Value("${elasticsearch.index.stock-change}")
    private String stockChangeIndex;

    // 需要 Lombok 或手动生成 getter/setter
    public List<String> getHosts() { return hosts; }
    public void setHosts(List<String> hosts) { this.hosts = hosts; }
    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }
    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getStockInfoIndex() {
        return stockInfoIndex;
    }

    public void setStockInfoIndex(String stockInfoIndex) {
        this.stockInfoIndex = stockInfoIndex;
    }

    public String getStockChangeIndex() {
        return stockChangeIndex;
    }

    public void setStockChangeIndex(String stockChangeIndex) {
        this.stockChangeIndex = stockChangeIndex;
    }
}